package com.chaoyong.higo.base;

import com.chaoyong.higo.R;
import com.chaoyong.higo.adapter.ViewPageFragmentAdapter;
import com.chaoyong.higo.view.PagerSlidingTabStrip;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Administrator on 2015/12/6.
 */
public class BaseViewpagerFragmentNormal extends CopyOfBaseFragment {

	protected PagerSlidingTabStrip mTabStrip;
	protected ViewPager mViewPager;
	protected ViewPageFragmentAdapter mTabsAdapter;
	// protected EmptyLayout mErrorLayout;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		mView = mInflater.inflate(R.layout.base_viewpage_fragment_normal, container,false);
		return mView;
	}
	
	@Override
	public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		mTabStrip = (PagerSlidingTabStrip) mView.findViewById(R.id.pager_tabstrip);

		mViewPager = (ViewPager) mView.findViewById(R.id.pager);

		// mErrorLayout = (EmptyLayout) view.findViewById(R.id.error_layout);

		mTabsAdapter = new ViewPageFragmentAdapter(getChildFragmentManager(), mTabStrip, mViewPager);
		setScreenPageLimit();
		onSetupTabAdapter(mTabsAdapter);
	}

	protected void setScreenPageLimit() {
	}

	protected void onSetupTabAdapter(ViewPageFragmentAdapter adapter) {
		
	}

}
